import { isPhoneNumber } from '@/utils/index'

export const formRules = {
  title: [{ required: true, validator: notEmpty, msg: '请输入消息标题', trigger: ['blur', 'change'] }],
  senderType: [{ required: true, validator: notEmpty, msg: '请选择消息类型', trigger: ['blur', 'change'] }],
  btnId: [{ required: true, validator: notEmpty, msg: '请选择消息用户清单', trigger: ['blur', 'change'] }],
  content: [{ required: true, validator: notEmpty, msg: '请填写消息内容', trigger: ['blur', 'change'] }],
}



// 校验不能为空
function notEmpty(rule, value, callback) {
  if (!value) {
    return callback(new Error(rule.msg))
  }else{
    return callback()
  }
}
